package com.kaikeba.service;

import com.kaikeba.bean.User;
import com.kaikeba.dao.BaseUserDao;
import com.kaikeba.dao.imp.UserDaoMysql;

import java.util.List;
import java.util.Map;

public class UserService {
    private static BaseUserDao dao = new UserDaoMysql();

    public static Map<String, Integer> console() {
        return dao.console();
    }


    public static boolean insert(User user) {
        return dao.insert(user);
    }

    public static boolean delete(int id) {
        return dao.delete(id);
    }

    public static boolean deleteByPhone(String phone){
        return dao.deleteByPhone(phone);
    }

    public static boolean updateByPhone(String phone, User user) {
        return dao.updateByPhone(phone, user);
    }
    
    public static List<User> findAll(int limit, int offset, int pageNumber) {
        return dao.findAll(limit, offset, pageNumber);
    }

    public static User findByPhone(String phone) {
        return dao.findByPhone(phone);
    }
}
